﻿CREATE PROCEDURE [dbo].[proc_Customer_ProtectCount]
	(
		@UserName nvarchar(50)
	)
AS	
begin tran
	declare @companyid int,@num int
	EXEC @companyid=proc_Company_GetID @UserName,@companyid--单位ID
	Select @num=Count(Id) From Customer Where ProtectName=@UserName and ProtectId=1 and Companyid=@companyid--用户现有的临时客户数
commit tran
	RETURN
